
using System;
using MonoTouch.UIKit;

namespace Hanselminutes
{


	public static class UIHelper
	{
		public static string FormatTimeSpan(TimeSpan span) {
			if (span.Hours > 0) {
				return string.Format("{0}:{1:00}:{2:00}", span.Hours, span.Minutes, span.Seconds);
			}
			else {
				return string.Format("{0}:{1:00}", span.Minutes, span.Seconds);
			}
		}
		public static string FormatTimeSpan(double secs) {
			if (double.IsNaN(secs)) {
				return "0:00";
			}
			else {
				return FormatTimeSpan(TimeSpan.FromSeconds(secs));
			}
		}
		public static void StopInternetActivity ()
		{
			UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
		}
		
		public static void StartInternetActivity ()
		{
			UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
		}
	}
}
